package com.lkf.simplewebcontainer.servlet;

import com.lkf.simplewebcontainer.http.Request;
import com.lkf.simplewebcontainer.http.Response;
import io.netty.handler.codec.http.HttpResponseStatus;

public class NotFoundServlet extends Servlet {

    private String content;

    public NotFoundServlet(String content) {
        this.content = content;
    }

    @Override
    public void doGet(Request request, Response response) throws Exception {
        response.write(content, HttpResponseStatus.NOT_FOUND, "text/json");
    }

    @Override
    public void doPost(Request request, Response response) throws Exception {
        doGet(request, response);
    }
}
